{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="{% static 'bootstrap-3.3.7-dist/css/bootstrap.min.css' %}">

</head>
<body>

<h1>添加书籍</h1>


<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <form action="" method="post" novalidate>

                {% csrf_token %}


                {% for field in book_obj %}
                   <div class="form-group">

                      {{ field.label }}
                      {{ field }}
                      <span class="text-danger">{{ field.errors.0 }}</span>

                  </div>
                {% endfor %}


{#              <div class="form-group">#}
{#                <label for="title">书名</label>#}
{#                <input type="text" class="form-control" id="title" placeholder="书名" name="title">#}
{#                  {{ book_obj.title.label }}#}
{#                  {{ book_obj.title }}#}
{##}
{#              </div>#}
{#                <div class="form-group">#}
{#                    {{ book_obj.price.label }}#}
{#                  {{ book_obj.price }}#}
{##}
{#                <label for="price">价格</label>#}
{#                <input type="text" class="form-control" id="price" placeholder="价格" name="price">#}
{#              </div>#}
{#                <div class="form-group">#}
{#                    {{ book_obj.publishDate.label }}#}
{#                  {{ book_obj.publishDate }}#}
{#                <label for="publishDate">出版日期</label>#}
{#                <input type="date" class="form-control" id="publishDate" name="publishDate">#}
{#              </div>#}
{#                <div class="form-group">#}
{#                    {{ book_obj.publishs.label }}#}
{#                  {{ book_obj.publishs }}#}
{#                <label for="title">出版社</label>#}
{#                    <select name="publishs_id" id="publishs" class="form-control">#}
{#                        {% for publish in all_publish %}#}
{#                            <option value="{{ publish.id }}">{{ publish.name }}</option>#}
{#                        {% endfor %}#}
{##}
{#                    </select>#}
{##}
{##}
{#              </div>#}
{#                <div class="form-group">#}
{#                    {{ book_obj.authors.label }}#}
{#                  {{ book_obj.authors }}#}
{#                <label for="title">作者</label>#}
{#                <select name="authors" id="authors" multiple class="form-control">#}
{#                        {% for author in all_authors %}#}
{#                            <option value="{{ author.id }}">{{ author.name }}</option>#}
{#                        {% endfor %}#}
{##}
{##}
{#                    </select>#}
{#              </div>#}


              <button type="submit" class="btn btn-success pull-right">提交</button>
            </form>



        </div>
    </div>

</div>






</body>
</html>